import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
  RouteRecordRaw,
  RouterView,
} from "vue-router";
import Layout from "../layout/index.vue";

const routes: RouteRecordRaw[] = [
  {
    path: "/",
    name: "Login",
    meta: {
      title: "登录",
    },
    component: () => import("../views/Login/index.vue"), // 注意这里要带上 文件后缀.vue
  },

  {
    path: "/Configure",
    component: Layout,
    meta: {
      title: "试题配置",
    },
    children: [
      {
        path: "/Configure",
        name: "Configure",
        component: () => import("../views/Configure/added.vue"),
        meta: {
          title: "新增题目",
        },
      },
    ],
  },
  {
    path: "/Sign",
    component: Layout,
    children: [
      {
        path: "/Sign",
        name: "Sign",
        component: () => import("../views/Sign/index.vue"),
        meta: {
          title: "报名管理",
        },
      },
    ],
  },
  {
    path: "/Result",
    component: Layout,
    meta: {
      title: "测验结果",
    },
    children: [
      {
        path: "/Result",
        name: "Result",
        component: () => import("../views/Result/question.vue"),
        meta: {
          title: "判题",
        },
      },
    ],
  },
  {
    path: "/Topic",
    component: Layout,
    children: [
      {
        path: "/Topic",
        name: "Topic",
        component: () => import("../views/Topic/index.vue"),
        meta: {
          title: "专题管理",
        },
      },
    ],
  },
  {
    path: "/Maths",
    component: Layout,
    children: [
      {
        path: "/Maths",
        name: "Maths",
        component: () => import("../views/Maths/index.vue"),
        meta: {
          title: "数学文化管理",
        },
      },
    ],
  },
  

 




];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
